home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12210 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: bmtlh10.bnr.ca!news
  2. From: John Hickin <hickin@bnr.ca>
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Re: Why is C faster than FORTRAN?
  5. Date: 18 Mar 1996 20:51:34 GMT
  6. Organization: Bell Northern Research
  7. Message-ID: <4ikicm$al6@bmtlh10.bnr.ca>
  8. References: <4hv2ho$d8t@news.interpath.net> <4i2c5e$t70@kiwi.futuris.net> <4i4poj$j7e@thorn.cc.usm.edu>
  9. NNTP-Posting-Host: bmtlh520.bnr.ca
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1 (X11; I; HP-UX A.09.05 9000/715)
  14. X-URL: news:4i4poj$j7e@thorn.cc.usm.edu
  15.  
  16. If, as I suspect, your program makes extemsive use of matrices, and you have
  17. written your own code as opposed to using something like IMSL packages, there
  18. may be a good reason: FORTRAN stores matrices by columns while C effectively
  19. stores them by rows.  Careful attention is required in the programming to take
  20. full advantage of the cache.  You may find, for example, that transposing your
  21. matrices and rewriting matrix multiplication to take this into account, will
  22. make a substantial difference.
  23.  
  24. -- 
  25. John Hickin      Nortel Technology, Montreal, Quebec
  26. (514) 765-7924   hickin@bnr.ca
  27.  
  28.